]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't override XAUTHORITY until after we run Xephyr
authorOwen Taylor <otaylor@src.gnome.org>
Mon, 3 Nov 2008 21:39:41 +0000 (21:39 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 3 Nov 2008 21:39:41 +0000 (21:39 +0000)
Don't override the setting of XAUTHORITY when running Xephyr,
since then we may not be able to connect to the host display.
Instead pass in the local auth file via the -auth command
line argument.

An alternate fix would be to use 'xauth merge' to merge the
existing XAUTHORITY file into our local file.

svn path=/trunk/; revision=29

scripts/start-in-Xephyr

index 0b20b1927edc46e78bac1a7ed1a9366778c46ebf..88c79a3b1b628035bac6eaf8b4891c5e29f3c3fe 100755 (executable)
@@ -29,14 +29,19 @@ try:
     hexkey = "".join(("%02x" % ord(byte) for byte in key))
 
     # Store that in an xauthority file as the key for connecting to our Xephyr
-    os.environ['XAUTHORITY'] = xauth_file
-    retcode = subprocess.call(["xauth", "add", display,  "MIT-MAGIC-COOKIE-1", hexkey])
+    retcode = subprocess.call(["xauth",
+                               "-f", xauth_file,
+                               "add", display,  "MIT-MAGIC-COOKIE-1", hexkey])
     if retcode != 0:
         raise RuntimeError("xauth failed")
 
     # Launch Xephyr
-    xephyr = subprocess.Popen(["Xephyr", display, "-screen", "800x600", "-host-cursor"])
+    xephyr = subprocess.Popen(["Xephyr", display,
+                               "-auth", xauth_file,
+                               "-screen", "800x600",
+                               "-host-cursor"])
     os.environ['DISPLAY'] = display
+    os.environ['XAUTHORITY'] = xauth_file
 
     # Wait for server to get going: LAME
     time.sleep(1)